<style>
.smallChildDiv{
	display:block;
}
#productLeft{
	float:none;
	border:1px #C2D8FE solid;
	width:97%;
	padding:10px;
}
#productLeft a{
	font-size:13px;
	background:none;
}
.flLable{
	color:#999999;
	text-decoration:none;
}
	.flLable:hover{
		color:#cccccc;
		font-size:15px;
	}

.headflDiv{
	background:url(html/images/topicsbg.gif) repeat-x bottom;
	height:25px;
	padding:5px 5px 0px 5px;
	text-align:left;
}
.middleflDiv{
	padding:10px;
	
}
.tailflDiv{
	text-align:center;
	padding:10px;
}
</style>
<script>
fenleiEffection.showOrHide=function(){
	return false;
}

function checkForm(){
	if(trim($('input[name="flname"]').val())==''){
		alert('请输入新分类名称!');
		return false;
	}
	$('#centerFlForm').submit();
}

var kuangManagement={
	kuang:new Object(),
	createKuang:function(thisA){
		var thisTishiKuang=getCenterDiv(700,130,175,70,'thisTishiKuang');
		var point=fGetXY(thisA);
		showBack();
		document.getElementsByTagName("body")[0].appendChild(thisTishiKuang);
		$('#thisTishiKuang').css('left','10px');
		$('#thisTishiKuang').css('top',parseInt(point.y)+'px');
		$('#thisTishiKuang').fadeIn('slow');
		$('#thisTishiKuang').css('paddingTop','0px');
		$('#thisTishiKuang').css('height','700px');
		this.kuang=thisTishiKuang;
	},
	shutKuang:function(){
		shutBack();
		$(this.kuang).remove();
	}
};

var myCenterDiv={
	headTitle:'',
	action:'',
	centerString:'',
	setCenterDiv:function(){

		this.centerString='<div class="centerflDiv" align="left">';
		this.centerString+='<form name="centerFlForm" id="centerFlForm" method="post" action="'+this.action+'">';
		this.centerString+='<div class="headflDiv"><a style="float:right" onclick="kuangManagement.shutKuang();">关闭</a>'+this.headTitle+'</div>';
		this.centerString+='<div class="middleflDiv">新分类英文名：<input name="en_flname" type="text" /></div>';
		this.centerString+='<div class="middleflDiv">新分类中文名：<input name="flname" type="text" /></div>';		             
                this.centerString+='<div class="tailflDiv"><input onclick="checkForm();" type="button" value="确定" /></div>';
		this.centerString+='</form>';
		this.centerString+='</div>';
	},
	getCenterDiv:function(){
		this.setCenterDiv();
		return this.centerString;
	}
};

var flManagement={
	alterfl:function(thisA){
		kuangManagement.shutKuang();
		kuangManagement.createKuang(thisA);
		myCenterDiv.headTitle="修改分类";
		myCenterDiv.action="administrator<?=CHOSING_DE?>location<?=CHOSING_DE?>alter?type=<?=$this->type?>";
		kuangManagement.kuang.innerHTML=myCenterDiv.getCenterDiv();
		$('input[name="en_flname"]').val($(thisA).prev().prev().html());
		//$('input[name="flname"]').val($(thisA).prev().html());
                //$('textarea[name="flbody"]').val($(thisA).prev().prev().attr('title'));
                $('textarea[name="flbody"]').val($(thisA).prev().html());
                $('input[name="flname"]').val($(thisA).prev().prev().attr('title'));
                $('select[name="openflag"]').val($(thisA).prev().prev().attr('alt'));               
		var flid=$(thisA).prev().prev().attr('name');
		$('#centerFlForm').append('<input type="hidden" value="'+flid+'" name="flid" />');
	},
	newfl:function(thisA){
		kuangManagement.shutKuang();
		kuangManagement.createKuang(thisA);
		myCenterDiv.headTitle="新增分类";
		myCenterDiv.action="administrator<?=CHOSING_DE?>location<?=CHOSING_DE?>new?type=<?=$this->type?>";
		kuangManagement.kuang.innerHTML=myCenterDiv.getCenterDiv();	
		if($(thisA).attr('name')=='root'){
			var flid=0;
		}else{
			//$('input[name="flname_cn"]').val($(thisA).prev().prev().html());
			var flid=$(thisA).prev().prev().prev().attr('name');
		}
		$('#centerFlForm').append('<input type="hidden" value="'+flid+'" name="flid" />');
	},
	delfl:function(thisA){
		if(!confirm('确定要删除该分类吗? 删除该分类会将其下的所有子分类都删除!')){
			return false;
		}
		var flid=$(thisA).prev().prev().prev().prev().attr('name');
		window.location.href="administrator<?=CHOSING_DE?>location<?=CHOSING_DE?>dodel?flid="+flid+"&type=<?=$this->type?>";
	}
};


</script>
<div class="frame_fenleiDiv" style="padding-bottom:150px">
	<div id="productLeft">
		<a class="flLable" href="javascript:;" name='root' onclick="flManagement.newfl(this);">新增根分类</a>
		<?=$this->fenleiString?>
	</div>
</div>